#include <iostream>

// https://zhuanlan.zhihu.com/p/256423512

class Test {
 private:
  int data;

 public:
  Test(int n);
  ~Test();
  int& getData() { return data; }
};

Test::Test(int n) : data(n) {}

Test::~Test() {}

int main(int argc, char const* argv[]) {
  //   const Test a(1);  const 修饰this指针
  Test a(1);
  std::cout << a.getData() << "\n";
  a.getData() = 3;
  std::cout << a.getData() << "\n";
  return 0;
}
